home *** CD-ROM | disk | FTP | other *** search
/ Commodore Disk User Volume 1 #5 / Commodore_Disk_User_Vol.1_5_1988_-.d64 / hi-res demo (.txt) < prev    next >
Commodore BASIC  |  2022-10-26  |  2KB  |  78 lines

  1. 10 rem*********************************
  2. 20 rem*                               *
  3. 30 rem*  demo program for hires       *
  4. 40 rem*        routines               *
  5. 50 rem*                               *
  6. 60 rem*********************************
  7. 70 rem
  8. 80 rem
  9. 90 if a=0then a=1:load "hires.mc",8,1
  10. 100 ad=49152
  11. 110 sh=ad:rem set up hires
  12. 120 tx=ad+3:rem text restore
  13. 130 ch=ad+6:rem clear screen
  14. 140 cc=ad+9:rem clear colour
  15. 150 ph=ad+12:rem plot hires
  16. 160 pc=ad+15:rem plot colour
  17. 170 pb=ad+18:rem plot both
  18. 172 ld=ad+21:rem plot line
  19. 174 hl=ad+24:rem horiz line
  20. 176 vl=ad+27:rem vert line
  21. 178 db=ad+30:rem box draw
  22. 180 xl=251:rem x low
  23. 190 xh=252:rem x high
  24. 200 yl=253:rem y coord
  25. 202 x1=14:rem end x  low
  26. 204 x2=15:rem end x  high
  27. 206 y1=255:rem end y
  28. 210 cb=2:rem colour byte
  29. 220 px=254:rem plot indicator
  30. 230 rem
  31. 240 rem menu
  32. 250 rem
  33. 260 print "[147]"
  34. 270 print "[158]          line drawing demo"
  35. 280 print:print tab(10);"1.  random lines"
  36. 290 print:print tab(10);"2.  random boxes"
  37. 300 print:print tab(10);"3.  both together"
  38. 310 print:print tab(10);"[158]enter option"
  39. 312 print:print "note: this program is only intended"
  40. 314 print "as an illustration. it may crash"
  41. 316 print "occasionally as the hi-res routines"
  42. 318 print "use some of the same locations as basic":print
  43. 320 get i$:if i$="" then 320
  44. 330 if i$>"3" or i$<"1" then 320
  45. 331 i=val(i$)
  46. 340 on i gosub 1000,2000,3000
  47. 360 sys tx:goto 260
  48. 900 rem
  49. 910 remrandom  lines
  50. 920 rem
  51. 1000 poke px,255:sys sh
  52. 1010 gosub 5000:sys ld
  53. 1020 get i$:if i$="" then 1010
  54. 1030 return
  55. 1900 rem
  56. 1910 rem random boxes
  57. 1920 rem
  58. 2000 poke px,255:poke cb,67:sys sh
  59. 2010 gosub 5000:sys db
  60. 2020 get i$:if i$="" then 2010
  61. 2030 return
  62. 2090 rem
  63. 2100 rem do both
  64. 2110 rem
  65. 3000 poke px,255:poke cb,67:sys sh
  66. 3010 gosub 5000:sys ld:gosub 5000:sys db
  67. 3020 get i$:if i$="" then 3010
  68. 3030 return
  69. 4900 rem
  70. 4910 rem set up coords
  71. 4920 rem
  72. 5000 poke px,255:x=int(rnd(1)*319)
  73. 5010 poke xl,x-int(x/256)*256:poke xh,int(x/256)
  74. 5020 x=int(rnd(1)*319)
  75. 5030 poke x1,x-int(x/256)*256:poke x2,int(x/256)
  76. 5040 poke yl,int(rnd(1)*199):poke y1,int(rnd(1)*199)
  77. 5050 return
  78.